CREATE TABLE [dbo].[TCCOMP_COBR]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[TI_COMP_COBR] [dbo].[TD_VC_003] NOT NULL,
[NU_COMP_COBR] [dbo].[TD_VC_008] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NULL,
[FE_COMP_COBR] [dbo].[TD_DT_001] NOT NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL,
[IM_TOTA] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TCCOMP_CO__IM_TO__160F4887] DEFAULT ((0)),
[NU_ANNO] [dbo].[TD_IN_004_ANOS] NULL,
[NU_MESE] [dbo].[TD_IN_002_MESE] NULL,
[DE_OBSE] [dbo].[TD_VC_100] NOT NULL,
[NU_CUOT] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCCOMP_CO__NU_CU__18EBB532] DEFAULT ((0)),
[ST_FECH_VENC] [dbo].[TD_VC_001] NOT NULL,
[NU_DIAS_VENC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCCOMP_CO__NU_DI__19DFD96B] DEFAULT ((0)),
[TI_SITU] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCOMP_CO__CO_US__1AD3FDA4] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCOMP_CO__FE_US__1BC821DD] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCOMP_CO__CO_US__1CBC4616] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCOMP_CO__FE_US__1DB06A4F] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCOMP_COBR] WITH NOCHECK ADD CONSTRAINT [CK__TCCOMP_CO__NU_AN__17036CC0] CHECK NOT FOR REPLICATION (([NU_ANNO]>(1980)))
GO
ALTER TABLE [dbo].[TCCOMP_COBR] WITH NOCHECK ADD CONSTRAINT [CK__TCCOMP_CO__NU_ME__17F790F9] CHECK NOT FOR REPLICATION (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TCCOMP_COBR] ADD CONSTRAINT [PK__TCCOMP_C__74F1CDBA03D16812] PRIMARY KEY CLUSTERED  ([CO_EMPR], [TI_COMP_COBR], [NU_COMP_COBR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCOMP_COBR] ADD CONSTRAINT [FK__TCCOMP_CO__CO_EM__7EC29A32] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TCCOMP_COBR] ADD CONSTRAINT [FK__TCCOMP_COBR__7DCE75F9] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
